package priv.stones.multi_thread.thread;

/**
 * @Author: Stones
 * @Description:
 * @Date: 2017/9/19 14:10
 */
public class Thread1 extends Thread {

    private Integer ticket = 5;

    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            if (ticket <= 0) {
                System.out.println("票卖完了");
            } else {
                System.out.println(i + "还剩" + --ticket+ "张票");
            }
        }
    }
}
